/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package eeep.controle;

import eeep.dao.TurmaDAO;
import eeep.entidades.Turma;
import eeep.excecoes.*;

/**
 *
 * @author Junior
 */
public class TurmaControle {
    TurmaDAO dao  = new TurmaDAO();
    public void salvarTurma(Turma turma)throws TJCException{
        try{
            this.buscarTurma(turma);
            throw new TJCException();
        }catch(TNEException e){
            dao.salvarTurma(turma);
        }
        
    }
    public Turma buscarTurma(Turma turma) throws TNEException{
        Turma aux = dao.buscarTurma(turma);
        if(aux!=null)
            return aux;
        else
            throw new TNEException();
    }
    
}
